/**  
 * Project Name:zj-main  
 * File Name:ProjectInfoServiceImpl.java  
 * Package Name:com.zhizai.zhujian.service.impl  
 * Date:2018年9月5日下午3:07:07  
 * Copyright (c) 2018, chenzhou1025@126.com All Rights Reserved.  
 *  
*/  
  
package com.zhizai.zhujian.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zhizai.zhujian.dao.ProjectInfoMapper;
import com.zhizai.zhujian.entity.ProjectInfo;
import com.zhizai.zhujian.service.ProjectInfoService;

/**  
 * ClassName:ProjectInfoServiceImpl <br/>  
 * Function: TODO ADD FUNCTION. <br/>  
 * Reason:   TODO ADD REASON. <br/>  
 * Date:     2018年9月5日 下午3:07:07 <br/>  
 * @author   feichao  
 */
@Service
@Transactional
public class ProjectInfoServiceImpl implements ProjectInfoService
{
    @Autowired
    private ProjectInfoMapper projectInfoMapper;
    
    public List<ProjectInfo> getProjectList(ProjectInfo projectInfo)
    {
        try
        {
            return projectInfoMapper.selectProjectInfo(projectInfo);
        }
        catch (Exception e)
        {
            e.printStackTrace();
            return null;
        }
    }

    public PageInfo<ProjectInfo> getProjects(String pageNum)
    {
        try {
            PageHelper.startPage(Integer.parseInt(pageNum), 10);
            List<ProjectInfo> projectInfos = projectInfoMapper.getProjectInfo();
            PageInfo<ProjectInfo> pageInfo = new PageInfo<ProjectInfo>(projectInfos);
            return pageInfo;
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }
    
}
  
